package com.itguigu.glimail.member;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import org.springframework.web.client.RestTemplate;

/**
 * 远程调用别的服务
 *  引入open-feign
 *  编写一个接口,告诉spring这个接口需要需要调用远程服务
 *   声明接口每一个方法都是调用哪个远程服务的哪个请求
 *     开启远程调用功能注解
 */
@EnableRedisHttpSession
@EnableFeignClients(basePackages = "com.itguigu.glimail.member.feign")
@EnableDiscoveryClient
@SpringBootApplication
public class GlimailMemberApplication {

    public static void main(String[] args) {
        SpringApplication.run(GlimailMemberApplication.class, args);
    }

    @Bean
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}
